package com.akkainaction.helloactor.forward.actor;

import akka.actor.ActorRef;
import akka.actor.Props;
import akka.actor.UntypedActor;

public class FrowardActor extends UntypedActor {

    private ActorRef target = getContext().actorOf(Props.create(TargetActor.class), "targetActor");

    @Override
    public void onReceive(Object msg) {
        System.out.println("forward actor接收到消息:[" + msg +"]消息的发送者是:"+getSender());
        target.forward(msg, getContext());
    }
}
